﻿using System;
using Mbs.ComponentModel.Container.Context;

namespace Mbs.ComponentModel.Container.Activation
{
    [Serializable]
    public class DelegateActivator : AbstractActivator
    {
        public Func<ICreateContext, object> Creator { get; internal set; }

        protected override object InternalCreate(ICreateContext context)
        {
            if (Creator != null)
                return Creator(context);
            return null;
        }
    }
}
